#include <bits/stdc++.h>
using namespace std;



int main()
{
	int sum = 0; int ans = 0;

	int t; cin >> t;
	for (int i = 0; i < t; i++)
	{
		int n; cin >> n;
		int a[1009] = { 0 };
		for (int j = 0; j < n; j++)
		{
			cin >> a[j];
			if (a[j] == 0)
			{
				a[j]++;
				ans++;
			}
			sum += a[j];

		}
		while (sum == 0)
		{
			ans++;
			sum++;
		}
		cout << ans << endl;
	}
	return 0;
}